<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="admin/common/header::common-head">
    <!--<#include "../common/header.html">-->
</head>
<body>
    <!--边栏-->
    <!--<#include "../common/nav.html">-->
    <div th:replace="admin/common/nav::common-nav" ></div>
    <!--<link href="https://cdn.bootcss.com/twitter-bootstrap/3.0.1/css/bootstrap.css" rel="stylesheet">-->
    <script src="https://cdn.bootcss.com/twitter-bootstrap/3.0.1/js/bootstrap.min.js"></script>

    <div class="content-wrapper" style="width: auto">
        <div class="container">
            <div class="row clearfix">
                <div class="col-md-12 column">
                    <div name="search" class="col-md-8 row-md-8">
                        <div class="input-group">
                            <button type="button" class="btn btn-lg active">角色编号</a></button>
                            <input class="form-control" type="text" placeholder="Search for..." id="search">
                            <span class="input-group-btn">
                                    <button class="btn btn-primary" type="button" id="enterSearch" onclick="searchProduct()">
                                        <i class="fa fa-search"></i>
                                    </button>
                                 </span>
                            &nbsp;&nbsp;&nbsp;&nbsp;
                            <button type="button" class="btn btn-lg active"><a href="/fashionpress/nick/add"> 添加角色</a></button>
<!--                            <button type="button" class="btn btn-lg active" th:if="${productStatus==null||productStatus==0}"><a href="/fashionpress/product/list?productStatus=1"> 下架商品列表</a></button>-->
<!--                            <button type="button" class="btn btn-lg active" th:if="${productStatus==1}"><a href="/fashionpress/product/list?productStatus=0"> 上架商品列表</a></button>-->
                        </div>
                    </div>
                    <table class="table">
                        <thead>
                            <tr>
                                <th>
                                    角色编号
                                </th>
                                <th>
                                    角色名
                                </th>
                                <th>
                                    角色权限
                                </th>
                                <th>
                                    操作
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr class="success" th:each="nick:${nicklist}" >
                                <td th:text="${nick.nickId}">

                                </td>
                                <td th:text="${nick.nickName}">

                                </td>
                                <td>
                                    <div th:each="role:${nick.roleList}">
                                        <input type="text" th:value="${role.roleName}+','" readonly="readonly" style="border: 0">
                                    </div>
                                </td>
                                <td><button type="button" class="btn active"><a th:href="@{/nick/update(nickId=${nick.nickId})}">修改</a></button>
                                    <button type="button" class="btn active updateProductStatus"><a th:href="@{/nick/delete(nickId=${nick.nickId})}">删除</a></button>
                                </td>
                            </tr>
                        </tbody>
                    </table>

                </div>
            </div>
            <div class="row clearfix">
                <div class="col-md-12 column">
<!--                    <ul class="pagination">-->
<!--                        <li th:if="${pagenum<=1}">-->
<!--                            <a href="#">Prev</a>-->
<!--                        </li>-->
<!--                        <li th:if="${pagenum>1}">-->
<!--                            <a th:href="@{/product/list/(productStatus=${productStatus},pagenum=${pagenum})}">Prev</a>-->
<!--                        </li>-->

<!--                        <li th:each="index:${#numbers.sequence(pagenum,totalPage)}">-->
<!--                            <a th:href="@{/product/list/(productStatus=${productStatus},pagenum=${index})}"><span th:text="${index}"></span></a>-->
<!--                        </li>-->

<!--                        <li th:if="${pagenum==totalPage}">-->
<!--                            <a href="#">Next</a>-->
<!--                        </li>-->
<!--                        <li th:if="${pagenum<totalPage}">-->
<!--                            <a href="/product/list?productStatus=${productStatus}&pagenum=${pagenum+1}">Next</a>-->
<!--                        </li>-->
<!--                    </ul>-->
                </div>
            </div>

        </div>



        <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
        <script>
            function searchProduct() {
                var serch = document.getElementById("search");
                var url = "/fashionpress/nick/selectBynickId/"+serch.value;
                window.location.href=url;

            }
            $(document).ready(function () {
                $(".updateProductStatus").click(function () {
                    $msg = "您确定要删除吗？"
                    if (confirm($msg)==true)
                        return true;
                    else{
                        return false;
                    }
                })
            });
        </script>

    </div>
    <div th:replace="admin/common/footer::common-footer"/>
</body>
</html>